If the menubar has an app-menu popover, and it is shown at the time of
disposing the window, it will attempt to transfer focus back to the
previous focus widget when undoing modality, even though the dispose()
code already did set_focus(NULL) previously.
At the time the popover is removed, there aren't many hints as to whether
the toplevel or the focus widget are being destroyed (ie. not still under
in_destruction), so just swap the order of these two calls.
For every other popover, this would all happen within dispose/destroy,
which is handled better.
GtkWindow *window = GTK_WINDOW (object);
GtkWindowPrivate *priv = window->priv;
+ unset_titlebar (window);
gtk_window_set_focus (window, NULL);
gtk_window_set_default (window, NULL);
- unset_titlebar (window);
remove_attach_widget (window);
G_OBJECT_CLASS (gtk_window_parent_class)->dispose (object);